change QwenImageTransformer UT to batch inputs#13312
change QwenImageTransformer UT to batch inputs#13312sayakpaul merged 7 commits intohuggingface:mainfrom
Conversation
sayakpaul
left a comment
There was a problem hiding this comment.
Thanks a lot. I left some further comments. LMK.
| f"Context parallel inference failed: {return_dict.get('error', 'Unknown error')}" | ||
| ) | ||
|
|
||
| @pytest.mark.xfail(reason="Context parallel may not support batch_size > 1") |
There was a problem hiding this comment.
Is it the case for Flux as well?
Also, let's always require get_dummy_inputs() to have batch_size. So, we can safely remove the inspect stuff from here and elsewhere.
There was a problem hiding this comment.
Is it the case for Flux as well?
yes. Flux works fine for bs > 2, will drop xfail once the qwenimage is fixed.
Also, let's always require
get_dummy_inputs()to havebatch_size. So, we can safely remove theinspectstuff from here and elsewhere.
Done. Add batch size args to newly refactored model: flux & flux2. Tests are passed
sayakpaul
left a comment
There was a problem hiding this comment.
Thanks for working on this!
|
Failing test is unrelated. |
What does this PR do?
This PR expands the inputs of
QwenImageUT from a single prompt to multiple prompts. SinceQwenImagePipelinealready supports multi-prompt inputs, we added corresponding test coverage here.Tested with following tests cases with success:
TestQwenImageTransformer;TestQwenImageTransformerMemory;TestQwenImageTransformerTraining;TestQwenImageTransformerAttention;TestQwenImageTransformerContextParallel;TestQwenImageTransformerLoRA
Tested with following tests cases with failure:
TestQwenImageTransformerLoRAHotSwap (Independent issues/bugs that also occurred on the main branch)
For ContextParallel, we keep bs=1 and will address it in another PR.
In this PR, we also add a check to skip the UT for ring attention when the SDPA backend is enabled. See the discussion in #13278.
Fixes # (issue)
QwenImageTransformerfrom a single prompt to multiple prompts in UTSDPA(“native”).Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@sayakpaul
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.